var Person = function (name) {
    this.name = name;

    // 对象属性
    this.introduce = function () {
        console.info("My name is " + this.name);
    };
};

// 类属性
Person.age = 26;
Person.eat = function ( stuff ) {
    console.info("I am eating " + stuff);
};

// 原型方法
Person.name_zh = "张三";
Person.prototype.introduce_zh  = function () {
    console.info("我的名字是" + this.name_zh);  // this undefined
}


var p = new Person("huoty");

// 对象属性
p.age = 21;
p.eat = function ( stuff ) {
    console.info("I am %s, age is %s, and eating %s", this.name, this.age, stuff);
}

console.dir(Person);
console.dir(p);
p.introduce();
p.introduce_zh();
p.eat("noodles");


//console.info("age:", p.age);  // age undefined
//p.eat("apple");  // eat undefined

console.info("age:", Person.age);
Person.eat("apple");
